import { Application } from 'egg';

export default (app: Application) => {
    const { STRING, CHAR, INTEGER } = app.Sequelize;
    const model = app.model.define('Paint', {
        paint_id: { type: CHAR(32), primaryKey: true }, // 画像ID
        paint_title: STRING(32), // 画像标题
        paint_order: INTEGER(20),  // 顺序
        paint_question: STRING(50), // 画像问题
        paint_type: CHAR(1), // 画像类型   1 选择 2 问答
        paint_selected_count: INTEGER(10), // 可选数量
        paint_status: CHAR(1), // 状态  1 正常 2 停用
        paint_color: CHAR(6), // 颜色
    }, { tableName: 't_paint' });
    return model;
};

export class Paint {
    paint_id: string;
    paint_title: string;
    paint_order: number;
    paint_querstion: string;
    paint_type: string;
    paint_selected_count: number;
    paint_status: string;
    paint_color: string;
}
